<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>Document</title>
        <style>
            *{
                padding: 0;
                margin: 0;
            }
            html,body{
                height: 100%;
            }
            .box{
                height: 100%;
                width: 100%;
            }
            .box-200-100{
                width: 200px;
                height: 100px;
            }
            .df{
                display: -webkit-flex;
                display: -moz-flex;
                display: -ms-flex;
                display: -o-flex;
                display: flex;
            }
            .f1{
                flex:1;
            }
            .bg-red{
                background-color: #f00;
            }
            .bg-green{
                background-color: #0f0;
            }
            .h-100p{
                height: 100%;
            }
            .container{
                height: 200px;
                width: 400px;
                background-color: #fc0;
            }
            .fd-c{
                flex-direction:column;
            }
            .fd-r{
                flex-direction:row;
            }
        </style>
    </head>
    <body>
        <p>flex-direction:row</p>
        <div class="df container fd-r f1">
            <div class="box-200-100 bg-green f1"></div>
        </div>
        <p>flex-direction:column</p>
        <div class="df container fd-c f1">
            <div class="box-200-100 bg-green f1"></div>
        </div>
    </body>
</html>